<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
test(() => {
  assert_selection(
    '<div>foo<div>bar|</div>baz</div>',
    selection => selection.modify('move', 'backward', 'paragraph'),
    '<div>foo|<div>bar</div>baz</div>');
  assert_selection(
    '<div>foo<span>bar|</span>baz</div>',
    selection => selection.modify('move', 'backward', 'paragraph'),
    '<div>|foo<span>bar</span>baz</div>');
    }, 'Selection.modify move backward by paragraph');

test(() => {
  assert_selection(
    '<div>foo<div>|bar</div>baz</div>',
    selection => selection.modify('move', 'forward', 'paragraph'),
    '<div>foo<div>bar</div>|baz</div>');
  assert_selection(
    '<div>foo<span>|bar</span>baz</div>',
    selection => selection.modify('move', 'forward', 'paragraph'),
    '<div>foo<span>bar</span>baz|</div>');
}, 'Selection.modify move forward by paragraph');
</script>